package com.kaguya.vams.domain.entity;

import java.time.LocalDateTime;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Email;
import javax.validation.constraints.Max;

/**
 * <p>
 * 用户 实体类
 * </p>
 *
 * @author kaguya
 * @since 2021-07-28
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SysUser extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 联系邮箱
     */
    @Email(message = "邮箱格式不正确")
    private String email;

    /**
     * 电话号码
     */
    private String phone;

    /**
     * 所在城市
     */
    private String city;

    /**
     * 上次登录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastLogin;

    /**
     * 角色集合
     */
    @TableField(exist = false)
    private List<SysRole> roles;


}
